using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Versions
{
    /// <summary>
    /// <para>Alter Version</para>
    /// <para>Alters the properties of a geodatabase version.</para>
    /// <para>更改地理数据库版本的属性。</para>
    /// </summary>    
    [DisplayName("Alter Version")]
    public class AlterVersion : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AlterVersion()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_workspace">
        /// <para>Input Workspace</para>
        /// <para><xdoc>
        ///   <para>The database connection file to the enterprise, workgroup, or desktop geodatabase where the version to be altered is located.</para>
        ///   <para>For branch versioning, use a feature service URL (that is, https://mysite.mydomain/server/rest/services/ElectricNetwork/FeatureServer) or the feature layer portal item.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要更改的版本所在的企业级、工作组级或桌面地理数据库的数据库连接文件。</para>
        ///   <para>对于分支版本控制，请使用要素服务 URL（即 https://mysite.mydomain/server/rest/services/ElectricNetwork/FeatureServer）或要素图层门户项目。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_in_version">
        /// <para>Input Version</para>
        /// <para>The name of the version to be altered. If altering a branch version from a database connection connected as the geodatabase administrator, the version name must also include the service name, for example, myservice.versionowner.versionname.</para>
        /// <para>要更改的版本的名称。如果从以地理数据库管理员身份连接的数据库连接更改分支版本，则版本名称还必须包含服务名称，例如 myservice.versionowner.versionname。</para>
        /// </param>
        public AlterVersion(object _in_workspace, object _in_version)
        {
            this._in_workspace = _in_workspace;
            this._in_version = _in_version;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Alter Version";

        public override string CallName => "management.AlterVersion";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_workspace, _in_version, _name, _description, _access.GetGPValue(), _out_workspace, _target_owner];

        /// <summary>
        /// <para>Input Workspace</para>
        /// <para><xdoc>
        ///   <para>The database connection file to the enterprise, workgroup, or desktop geodatabase where the version to be altered is located.</para>
        ///   <para>For branch versioning, use a feature service URL (that is, https://mysite.mydomain/server/rest/services/ElectricNetwork/FeatureServer) or the feature layer portal item.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要更改的版本所在的企业级、工作组级或桌面地理数据库的数据库连接文件。</para>
        ///   <para>对于分支版本控制，请使用要素服务 URL（即 https://mysite.mydomain/server/rest/services/ElectricNetwork/FeatureServer）或要素图层门户项目。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_workspace { get; set; }


        /// <summary>
        /// <para>Input Version</para>
        /// <para>The name of the version to be altered. If altering a branch version from a database connection connected as the geodatabase administrator, the version name must also include the service name, for example, myservice.versionowner.versionname.</para>
        /// <para>要更改的版本的名称。如果从以地理数据库管理员身份连接的数据库连接更改分支版本，则版本名称还必须包含服务名称，例如 myservice.versionowner.versionname。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Version")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_version { get; set; }


        /// <summary>
        /// <para>Version Name</para>
        /// <para>The new name of the version.</para>
        /// <para>版本的新名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Version Name")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _name { get; set; } = null;


        /// <summary>
        /// <para>Version Description</para>
        /// <para>The new description of the version.</para>
        /// <para>版本的新说明。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Version Description")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _description { get; set; } = null;


        /// <summary>
        /// <para>Access Permission</para>
        /// <para><xdoc>
        ///   <para>Specifies the access permission for the version. If no value is specified, the access permission will not be updated.</para>
        ///   <bulletList>
        ///     <bullet_item>Private—Only the owner can view the version and modify available feature classes.</bullet_item><para/>
        ///     <bullet_item>Public— Any user can view the version and modify available feature classes.</bullet_item><para/>
        ///     <bullet_item>Protected—Any user can view the version, but only the owner can modify available feature classes.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定版本的访问权限。如果未指定任何值，则不会更新访问权限。</para>
        ///   <bulletList>
        ///     <bullet_item>私有 - 只有所有者才能查看版本和修改可用要素类。</bullet_item><para/>
        ///     <bullet_item>公共 - 任何用户都可以查看版本并修改可用要素类。</bullet_item><para/>
        ///     <bullet_item>受保护 - 任何用户都可以查看版本，但只有所有者可以修改可用的要素类。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Access Permission")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _access_value? _access { get; set; } = null;

        public enum _access_value
        {
            /// <summary>
            /// <para>Private</para>
            /// <para>Private—Only the owner can view the version and modify available feature classes.</para>
            /// <para>私有 - 只有所有者才能查看版本和修改可用要素类。</para>
            /// </summary>
            [Description("Private")]
            [GPEnumValue("PRIVATE")]
            _PRIVATE,

            /// <summary>
            /// <para>Public</para>
            /// <para>Public— Any user can view the version and modify available feature classes.</para>
            /// <para>公共 - 任何用户都可以查看版本并修改可用要素类。</para>
            /// </summary>
            [Description("Public")]
            [GPEnumValue("PUBLIC")]
            _PUBLIC,

            /// <summary>
            /// <para>Protected</para>
            /// <para>Protected—Any user can view the version, but only the owner can modify available feature classes.</para>
            /// <para>受保护 - 任何用户都可以查看版本，但只有所有者可以修改可用的要素类。</para>
            /// </summary>
            [Description("Protected")]
            [GPEnumValue("PROTECTED")]
            _PROTECTED,

        }

        /// <summary>
        /// <para>Updated Geodatabase</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Geodatabase")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_workspace { get; set; }


        /// <summary>
        /// <para>Target Owner</para>
        /// <para>The name of the portal user to which the version ownership will be transferred. Ensure that the target owner user exists; the tool does not check the validity of the owner name specified. This parameter is only applicable for branch versions.</para>
        /// <para>版本所有权将转移到的门户用户的名称。确保目标所有者用户存在;该工具不会检查指定的所有者名称的有效性。该参数仅适用于分支版本。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Target Owner")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _target_owner { get; set; } = null;


        public AlterVersion SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}